<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>添加项目</title>
		<meta name="keywords" content="raorao Config" />
		<meta name="description" content="[raorao Config]基于Spring Boot Starter的小型Config框架" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />

		<!-- basic styles -->
		<link href="ace/assets/css/bootstrap.min.css" rel="stylesheet" />
	</head>

	<body>
		<form action="#" id="form_project">
			<table>
				<tbody>
				<tr>
					<td><label>项目名称：</label></td>
					<td><input type="text" id="input_cname" name="cname" placeholder="项目名" /></td>
				</tr>
				<tr>
					<td><label>项目编码：</label></td>
					<td><input type="text" id="input_code" name="code" placeholder="项目编码" /></td>
				</tr>
				<tr>
					<td><label>环境：</label></td>
					<td><input type="text" id="input_environment" name="environment" placeholder="环境" /></td>
				</tr>
				<tr>
					<td><label>版本号：</label></td>
					<td><input type="text" id="input_version" name="version" placeholder="版本号" /></td>
				</tr>
				<tr>
					<td><label>备注：</label></td>
					<td><input type="text" id="input_remark" name="remark" placeholder="备注" /></td>
				</tr>
				<tr>
					<td><input type="button" id="btn_submit" value="提交" /></td>
					<td><input type="button" id="btn_cancle" value="取消"  /></td>
				</tr>
				</tbody>
			</table>
		</form>
	</body>
</html>
<script src="ace/assets/js/jquery-2.0.3.min.js"></script>
<script src="ace/assets/js/bootstrap.min.js"></script>
<script src="js/JqeryHelper.js"></script>
<script>
	$(function () {

		$("#btn_submit").click(function () {
			var json=$("#form_project").serializeQuerystring();
			$.post("project/add",json,function(result){
				if(result["code"]==200){
					alert("添加成功！")
				}else{
					alert("添加失败！")
				}
				window.close();   //关闭本窗口
			})

		});

		$("#btn_cancle").click(function () {
			window.close();   //关闭本窗口
		});

	});
</script>